<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <input type="text" class="user">
    <input type="text" class="pwd">
    <button>登陆</button>


    <!-- <script src="../js/cookie.js"></script> -->

    <script src="../js/api.js"></script>

    <script src="../js/ajax.js"></script>

    <script>

        // 登陆成功以后
        //    默认跳转到首页
        //    其他页面来源就  哪里来回哪里去   ----  在来源的地方通过地址栏问号拼接携带地址



        document.querySelector('button').onclick = async function () {
            const username = document.querySelector('.user').value;
            const password = document.querySelector('.pwd').value;

            // 校验
            const res = await login({
                username,
                password
            })

            console.log(res);



        }









    </script>

</body>

</html>